class Dog {
  name: string
  age: number
  /** 
   * 当执行 new时会自动调用 constructor函数
   * this的指向是实例化对象
   */
  constructor(name: string, age: number) {
    this.name = name
    this.age = age
  }
}

const x = new Dog('cz', 9)
const y = new Dog('ab', 19)
console.log(x);
console.log(y);

